'use strict';
const {
    Model
} = require('sequelize');
const db = require('./index.js')
module.exports = (sequelize, DataTypes) => {
    class Role extends Model {
        /**
         * Helper method for defining associations.
         * This method is not a part of Sequelize lifecycle.
         * The `models/index` file will call this method automatically.
         */
        static associate(models) {
            // define association here
        }
    }
    Role.init({
        role_id: {
            type: DataTypes.INTEGER,
            allowNull: false,
            primaryKey: true,
            autoIncrement: true,
            unique: true,
        },
        roleName: DataTypes.STRING,
    }, {
        sequelize, //传递的实例化后的对象
        modelName: 'Role',
    });
    return Role;
};